ImageSource
Specifies an image to be displayed in place of the specified character in a field. Syntax: set the imageSource of to { | | |empty} Examples: set the imageSource of char 1 of line 2 of field "This" to 2533 set the imageSource of char thisChar of field 1 to "Arrow" set the imageSource of last char of me to "binfile:My Image" Use the imageSource property to display a picture or icon inside a text field. Setting the imageSource of a character hides the character. Setting the imageSource of a character to empty removes the image and allows the character to appear instead. If the image is noticeably taller than the text in the field, it may appear cut off if the field's fixedLineHeight property is set to true. To correct this problem, set the field's fixedLineHeight to false. Do not use the URL keyword when specifying an image URL. The imageSource of a character is a file location (or image ID or name), not the image data itself. If you use the URL keyword, the imageSource property is set to the contents of the URL, not the URL itself, and this is usually not what's wanted. Notice that besides jpg and png images you could use animated gif as imageSource. The animated gif displays correctly within the text field. If you change the size of the image or apply an ink effect (like srcAnd) the imageSource will reflect these changes within the text field. Notes If you put one field into another, any images in the source field, will not appear in the destination field (the imagesource values aren't copied across). One way to copy imagesource derived images (and other attributes of the source field, such as background colour etc.) is to set the htmltext of the destination field to that of the source field. If an imagesource is retrieved from an external file, Livecode caches the image in memory. If the image file content changes (for example, if it is edited in a graphics program outside of Rev, or if a script replaces its content but keeps the file name the same) the change will not be reflected in any field that is using it as an imagesource. To force Rev to update the imagesource from the original file, set the imagesource to a non-existant file (or even just a space) and then immediately reset it to the original file name again. For example, this will force Rev to reload the same image if its content has changed: set the imagesource of char 1 of fld 1 to space -- replace the original imagesource with nonvalid data set the imagesource of char 1 of fld 1 to "binfile:myImageFile.jpg" -- reloads the original image from disk Changes: The order in which LiveCode searches for imageSource IDs was changed in version 3.5. Previously, the current stack was searched first, followed by the list of open stacks. See also: stacks (function),field (object),icon (property),behavior (property),fixedLineHeight (property),name (property), Category: multimedia Category:Text processing Category:Images